// /////////////////////////////////////////////////////////////////////////////
//
// Name:            App.cpp
// Author:          Michael Bartsch
//
// Desc :           This is the main file in which we'll start the application.
//
// License:         Copyright (C) 2008-2009 Michael Bartsch
//
//                  This program is free software: you can redistribute it
//                  and/or modify it under the terms of the GNU General Public
//                  License as published by the Free Software Foundation,
//                  either version 3 of the License, or (at your option) any
//                  later version.
//
//                  This program is distributed in the hope that it will be
//                  useful, but WITHOUT ANY WARRANTY; without even the implied
//                  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
//                  PURPOSE. See the GNU General Public License for more
//                  details.
//
//                  You should have received a copy of the GNU General Public
//                  License along with this program. If not, see
//                  <http://www.gnu.org/licenses/>.
//
// /////////////////////////////////////////////////////////////////////////////

// Include required header file(s).
#include "App.h"


// CApp Class - Main entry point for application.
IMPLEMENT_APP(CApp)

// Initialises the application.
bool CApp::OnInit()
{
    // Load and display the splash screen.
    wxImage::AddHandler(new wxPNGHandler);
    wxBitmap splashBitmap;

    if(splashBitmap.LoadFile("../media/splash.png", wxBITMAP_TYPE_PNG))
    {
       new wxSplashScreen(splashBitmap,
           wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT,
           1500, NULL, -1, wxDefaultPosition, wxDefaultSize,
           wxSIMPLE_BORDER|wxSTAY_ON_TOP);
    }

    Yield();

    // Initialise the main frame.
    CMainFrame *m_pMainFrame = new CMainFrame();
    m_pMainFrame->Centre();
    m_pMainFrame->Show(TRUE);
    SetTopWindow(m_pMainFrame);

    return true;
}

// Clears the application on shutdown.
int CApp::OnExit()
{
    return 0;
}

// End of File
